#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if 0
int main(void)
{
	unsigned char i = 7;
	int j = 0;
	for (; i > 0; i -= 3)
	{
		++j;
	}
	printf("%d\n", j);
	return 0;
}

struct One
{
	double d;
	char c;
	int i;
};

struct Two
{
	char c;
	double d;
	int i;
};

int x = 1;
do
{
	printf("%2d\n".x++);
} while (x--);

void main()
{
	int a = -3;
	unsigned int b = 2;
	long c = a + b;
	printf("%ld\n", c);
}

int fun(int a)
{
	a ^= (1 << 5) - 1;
	return a;
}

#define N 3+1
#define Y(n)((N+1)*n)

char a; int b; float c; double d;

int main(void)
{
	char arr[20] = { 0 };
	int N = 0;
	scanf("%d", &N);
	int k = 0;
	int i = 0;
	while (N)
	{
		if (k != 0 && k % 3 == 0)
		{
			arr[i++] = ',';
		}
		arr[i++] = N % 10 + '0';
		N = N / 10;
		k++;
	}
	for (i--; i >= 0; i--)
	{
		printf("%c", arr[i]);
	}
	return 0;
}

int is_exist(char ch, char arr[])
{
	int i = 0;
	while (arr[i])
	{
		if (ch == arr[i])
		{
			return 1;
		}
		i++;
	}
	return 0;
}


int main(void)
{
	char arr1[200] = { 0 };
	char arr2[200] = { 0 };
	scanf("%[^\n]s", arr1);
	getchar();
	scanf("%[^\n]s", arr2);

	int i = 0;
	while (arr1[i])
	{
		if(strchr(arr2, arr1[i]) == NULL)
		{
			printf("%c", arr1[i]);
		}
		i++;
	}
	return 0;
}
#endif

